//
//  ComicsTableViewCell.m
//  Cartoon
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 YSZ. All rights reserved.
//

#import "ComicsTableViewCell.h"
#import "ComicsModel.h"
@implementation ComicsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _cover_urlImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_cover_urlImageView];
        _cover_urlImageView.layer.cornerRadius = 10;
        _cover_urlImageView.clipsToBounds = YES;
        
        _lated_seqnoLabel = [[UILabel alloc] init];
        [_cover_urlImageView addSubview:_lated_seqnoLabel];
        _lated_seqnoLabel.backgroundColor = [UIColor orangeColor];
        _lated_seqnoLabel.textColor = [UIColor whiteColor];
        _lated_seqnoLabel.font = [UIFont systemFontOfSize:12];
        _lated_seqnoLabel.layer.cornerRadius = 10;
        _lated_seqnoLabel.clipsToBounds = YES;
        _lated_seqnoLabel.textAlignment = NSTextAlignmentCenter;

        
    }

    return self;
}

- (void)setComicsModel:(ComicsModel *)comicsModel
{
    _comicsModel = comicsModel;
    [_cover_urlImageView sd_setImageWithURL:[NSURL URLWithString:comicsModel.cover_url]placeholderImage:[UIImage imageNamed:@"5"]];
    self.lated_seqnoLabel.text = [comicsModel.lated_seqno stringValue];

}

+ (instancetype)comiscsCellWithTableView:(UITableView *)tableView
{

    ComicsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    return cell;
    
}

- (void)layoutSubviews
{

    [super layoutSubviews];
    _cover_urlImageView.frame = CGRectMake(5, 5, 365, 180);
    _lated_seqnoLabel.frame = CGRectMake(345, 80, 20, 20);

}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
